/*
 * Created by Dev c++ 5.11
 * Author: liyih
 * Date: 2018/03/14
 */

#include <iostream>
#include <list>
using namespace std;
int main()
{
	int n, m;
	list<char>a;
	char t;
	cin>>n;
	while(n--){
		cin>>t;
		a.push_back(t);
	}
	cin>>m;
	while(m--){
		cin>>t;
		a.push_back(t);
	}
	list<char>::iterator it = a.begin();
	while(it != a.end()){
		cout<<*it<<" ";
		it++;
	}
	return 0;
}
